<me:UIWBBST x:Class="WPFExcelReport.TWB2WH"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
         xmlns:me="clr-namespace:WPFExcelReport" 
         xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
         xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
         xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
         xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
         xmlns:WFW="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
         xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
         xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
         x:Name="TV"
         Loaded="Window_Loaded"
         IsVV="True"
         IsPage="True" 
         Rows="10"
         FTAUTOSUM="True" 
         SKEY1="WBBART"
         KEY1="WBBISTKLG"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:M2YD x:Key="M2YD"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
    </me:UIWBBST.Resources> 
    <Expander IsExpanded="{Binding IsShow,ElementName=TV}">
        <Expander.Header>
            <WrapPanel>
                <ex:TSUMWB/>
            </WrapPanel>
        </Expander.Header>    
    <Grid>
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition> 
        </Grid.RowDefinitions>
            <ex:TPage  Grid.Row="0" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
            <DataGrid  Grid.Row="1" Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                       IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster" 
                    RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0">
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=小卷号}}" Foreground="Red" Binding="{Binding WBBPACKNR}"/>
                <DataGridTextColumn  IsReadOnly="True"  Header="{Binding Source={Localization:Translate Word=布卷号}}" Binding="{Binding WBBSTKNR, Converter={StaticResource ResourceKey=pnum}}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=格型}}" Binding="{Binding WBBDPART}"  Width="40"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=色级}}" Binding="{Binding WBBTAX}"  Width="40"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(米)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(码)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=KM2YD}}"/>
                <DataGridTextColumn  IsReadOnly="True"  Header="{Binding Source={Localization:Translate Word=后整理}}" Binding="{Binding WBBBESCHICH}" Visibility="Collapsed"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
    </Expander>
</me:UIWBBST>
